package com.sky.mapper;

import com.sky.entity.ShoppingCart;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author liudo
 * @version 1.0
 * @project sky-take-out
 * @date 2023/12/10 14:14:58
 */
@Mapper
public interface ShoppingCartMapper {
    /**
     * 选择一个
     *
     * @param shoppingCartQuery 购物车查询
     * @return {@link ShoppingCart}
     */
    ShoppingCart selectOne(ShoppingCart shoppingCartQuery);

    /**
     * 插入
     *
     * @param shoppingCart 购物车
     */
    void insert(ShoppingCart shoppingCart);

    /**
     * 按id更新
     *
     * @param shoppingCart 购物车
     */
    void updateById(ShoppingCart shoppingCart);

    /**
     * 选择列表
     *
     * @param shoppingCartQuery 购物车查询
     * @return {@link List}<{@link ShoppingCart}>
     */
    List<ShoppingCart> selectList(ShoppingCart shoppingCartQuery);

    /**
     * 删去
     *
     * @param shoppingCartQuery 购物车查询
     */
    void delete(ShoppingCart shoppingCartQuery);


    /**
     * 批量插入
     *
     * @param shoppingCarts 购物车
     */
    void insertBatch(List<ShoppingCart> shoppingCarts);
}
